package com.gm.mapper;

import com.gm.entity.Department;
import org.apache.ibatis.annotations.*;

/**
 * @Author Administrator
 * @Date 2020/6/17 15:58
 **/
//@Mapper指定这是操作数据库的Mapper
//@Mapper
public interface DeptMapper {
    //查询
    @Select("select * from department where id = #{id}")
    Department getDeptById(Integer id);
    //增加
    @Options(useGeneratedKeys = true,keyProperty = "id")
    @Insert("insert into department(departmentName) values (#{departmentName})")
    int addDept(Department department);
    //删除
    @Delete("delete from department where id = #{id}")
    int delDept(Integer id);
    //修改
    @Update("update department set departmentName = #{departmentName} where id = #{id}")
    int updDept(Department department);
}
